{ open Parser }


rule token=parse 
| "/*"     { comment lexbuf }           (* Comments *)
| [' ' '\t' '\r' '\n'] { token lexbuf } (* Whitespace *)     
| '('                   {LPAREN}
| ')'                   {RPAREN}
| '{'                   {LBRACE}
| '}'                   {RBRACE}
| ';'                   {SEMI}
| ','      	            {COMMA}
| '='                   {ASSIGN}
| '.'                   {POINT}
(*key words*)

|"SingleSelection"      {SINGLE}
|"MultipleSelection"    {MULTIPLE}
|"DropdownList"	        {DROP}
|"TextField"	        {TEXT}
|"Title"	       	    {TITLE}
|"Question"	            {QUESTION}
|"QuestionSet"          {QUESTIONSET}
|"New"		            {NEW}
|"Display"				{DISPLAY}
|"AddQuestion"          {ADDQUESTION}

| ['a'-'z' 'A'-'Z']['a'-'z' 'A'-'Z' '0'-'9' '_']* as lxm { ID(lxm) }
| ['0'-'9']+ as num { LITERAL(num) }
| '"'[^'"']*'"' as st { STRING_LITERAL(st) }


(*special character process*)
| _ as char { raise (Failure("illegal character " ^ Char.escaped char))}

| eof { EOF }

and comment = parse
  "*/" { token lexbuf }
| _    { comment lexbuf }

